﻿using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ES.EsEntity
{
    [Serializable]
    [ElasticsearchType(IdProperty = "PID", Name = "espolicyinfo")]
    public class EsPolicyInfo
    {
        /// <summary>
        /// 
        /// </summary>		
        [Number(NumberType.Integer, Name = "PID", Index = true)]
        public long PID { get; set; }
        /// <summary>
        /// 政策标题
        /// </summary>		 		
        [Text(Name = "PolicyTitle", Index = true, Analyzer = "ik_smart")]
        public string PolicyTitle { get; set; }
        /// <summary>
        /// 政策关键字
        /// </summary>	
        [Text(Name = "PolicyKey", Index = true,Analyzer = "ik_smart")]
        public string PolicyKey { get; set; }
        /// <summary>
        /// 责任编辑
        /// </summary>	 
        [Keyword(Name = "Author")]
        public string Author { get; set; }
        /// <summary>
        /// 来源（发文单位）
        /// </summary>		 
        [Text(Name = "Source", Index = true, Analyzer = "ik_smart")]
        public string Source { get; set; }
        /// <summary>
        /// 文件类型ID
        /// </summary>		 
        [Keyword]
        public int ChannelId { get; set; }
        /// <summary>
        /// 省ID
        /// </summary>   
        public int ProvinceID { get; set; }
        /// <summary>
        /// 省名称
        /// </summary>	
        public string ProvinceName { get; set; }
        /// <summary>
        /// 市ID
        /// </summary>	 
        public int CityID { get; set; }
        /// <summary>
        /// 市名称
        /// </summary>	 
        public string CityName { get; set; }
        /// <summary>
        /// 区ID
        /// </summary>	
        public int CountyID { get; set; }
        /// <summary>
        /// 区名称
        /// </summary>	 
        public string CountyName { get; set; }
        /// <summary>
        /// 文件级别
        /// </summary>		 
        [Keyword(Name = "GradeID")]
        public int GradeID { get; set; }
        /// <summary>
        /// 文件类型
        /// </summary>		 
        [Keyword(Name = "ChannelName")]
        public string ChannelName { get; set; }
        /// <summary>
        /// 适用企业类型
        /// </summary> 
        [Keyword(Name = "SuitID")]
        public string SuitID { get; set; }
        /// <summary>
        /// 发文系统ID
        /// </summary>		 
        [Text(Name = "ReleaseID", Index = true, Analyzer = "ik_smart")]
        public string ReleaseID { get; set; }
        /// <summary>
        /// 发文系统名称
        /// </summary>	 
        [Keyword(Name = "ReleaseName")]
        public string ReleaseName { get; set; }
        /// <summary>
        /// 发文时间
        /// </summary>	 
        [Date(Name = "ReleaseTime", Index = false)]
        public DateTime ReleaseTime { get; set; }
        /// <summary>
        /// 阅读数
        /// </summary>	 
        [Keyword(Name = "Reads")]
        public int Reads { get; set; }
        /// <summary>
        /// 区域IDList
        /// </summary>
        public string AreaList { get; set; }
        /// <summary>
        /// 发文时间
        /// </summary>		
        public string ReleaseDate
        {
            get
            {
                return ReleaseTime.ToString("yyyy-MM-dd");
            }
        }
        /// <summary>
        /// 是否存在测评
        /// </summary>		 
        [Boolean(Name = "IsAssessment", Index = false)]
        public bool IsAssessment { get; set; }
        /// <summary>
        /// 截止时间
        /// </summary>		 
        [Date(Name = "EndTime", Index = false)]
        public DateTime? EndTime { get; set; }
        /// <summary>
        /// 是否存在秘籍
        /// </summary> 
        [Boolean(Name = "IsEsoterica", Index = false)]
        public bool IsEsoterica { get; set; }
        /// <summary>
        /// 是否存在视频
        /// </summary>		 
        [Boolean(Name = "IsVideo", Index = false)]
        public bool IsVideo { get; set; }
        /// <summary>
        /// 是否文字解读
        /// </summary>		 
        [Boolean(Name = "IsJiedu", Index = false)]
        public bool IsJiedu { get; set; }
    }

}
